<template>
  <div>
<Form ref="searchForm" :model="params" inline :label-width="120" :label-colon="true">
      <!--农村名称-->
      <FormItem label="农村ID">
        <Input v-model="params.fkRuralId" placeholder="请输入农村ID"/>
      </FormItem>
      <FormItem label="统计年份">
        <DatePicker @on-change="params.statisticsYear = $event"  type="year" format="yyyy"  v-model="params.statisticsYear" placeholder="请选择统计年份"
                    style="width: 200px"></DatePicker>
      </FormItem>
      <FormItem :label-width="0">
        <Button style="margin-right: 10px" type="primary" @click='publicGetData'>查询</Button>
        <Button type="primary" @click='publicUpdateData'>新增</Button>
      </FormItem>
    </Form>
    <Breadcrumb></Breadcrumb>
    <BaseTable ref="baseTable"
               :action="action.readParty"
               :columns="columns"
               :public-btn="['view','update','delete']"
               @handleView="publicUpdateData"
               @handleUpdate="publicUpdateData"
               @handleRemove='publicRemoveData'>
    </BaseTable>
    <Drawer :width="500"
            :draggable="true"
            :title="viewParams.title"
            :closable="false"
            v-model="viewParams.flag"
           @on-visible-change="publicVisibleChange">
      <ruralGridDistributionUpdate :type="type"
                              :moduleId="id"
                              :idName="idName"
                              :key="isRefreshView"
                              @closeView="publicCloseView">
      </ruralGridDistributionUpdate>
    </Drawer>
  </div>
</template>
<script>
import { tableMixin } from '@/mixin/index'
import columns from './rural_columns.js'
import API_KEY from '../../../api'
export default {
  mixins: [tableMixin], // 混入合并
  data () {
    return {
      columns, // 表格列字段
      params: { // 搜索条件
        fkRuralId: '',
        statisticsYear: ''
      },
      action: { // 接口API地址
        readParty: API_KEY.ruralGridDistribution.page, // 分页查询地址
        removeDataByKey: API_KEY.ruralGridDistribution.curdRural // 删除
      },
      prefix: '农村党支部信息',
      idName: 'id', // 主键字段名
      id: '' // 主键值
    }
  },
  components: {
    ruralGridDistributionUpdate: () => import('./ruralGridDistributionUpdate')
  }
}
</script>

<style scoped lang="scss">
/deep/ .ivu-select-dropdown {
  color: #000 !important;
}
</style>
